#include "Parser.h"

Parser::Parser() : ParserBase(NULL){
	// Initializes the chain of responsibility
	parserCatchAll = new ParserCatchAll();
	parserUndo = new ParserUndo(parserCatchAll);
	parserClear = new ParserClear(parserUndo);
	parserDone = new ParserDone(parserClear);
	parserDelete = new ParserDelete(parserDone);
	parserEdit = new ParserEdit(parserDelete);
	parserSort = new ParserSort(parserEdit);
	parserList = new ParserList(parserSort);
	parserAdd = new ParserAdd(parserList);

	nextParser = parserAdd;
}

Parser::~Parser() {
	delete parserAdd;
	delete parserList;
	delete parserSort;
	delete parserEdit;
	delete parserDelete;
	delete parserDone;
	delete parserCatchAll;
	delete parserClear;
}

bool Parser::tryParse(string userCommand, PARSED_COMMAND& parsedCommand) {
	return false;
}